toRight

inline fun <L> toRight(left: () -> L): Either<L, T>

Returns a Left containing the given argument left if this is empty, or a Right containing this option's value if it is defined.

Return

a Left containing the given argument left if this is empty, or a Right containing this option's value if it is defined.

Parameters

left

Producer of the fallback Left value.

L

The type of the Left value.